<template>
  <div class="admin-container">
    <el-card class="admin-card">
      <template #header>
        <div class="card-header">
          <h2>管理后台</h2>
        </div>
      </template>

      <el-tabs v-model="activeTab" class="admin-tabs">
        <el-tab-pane label="用户管理" name="users">
          <UserManagement />
        </el-tab-pane>
        <el-tab-pane label="订阅管理" name="subscriptions">
          <SubscriptionManagement />
        </el-tab-pane>
        <el-tab-pane label="通知管理" name="notifications">
          <NotificationManagement />
        </el-tab-pane>
        <el-tab-pane label="系统设置" name="settings">
          <SystemSettings />
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import UserManagement from '../components/admin/UserManagement.vue'
import SubscriptionManagement from '../components/admin/SubscriptionManagement.vue'
import NotificationManagement from '../components/admin/NotificationManagement.vue'
import SystemSettings from '../components/admin/SystemSettings.vue'

const activeTab = ref('users')
</script>

<style scoped>
.admin-container {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-card {
  width: 100%;
  margin: 0 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  margin: 0;
}

.admin-tabs {
  margin-top: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

:deep(.el-tabs__content) {
  flex: 1;
  overflow: auto;
}
</style> 